//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <cstdlib>

#include <iostream>
#include <fstream>

#include "ExtractPDBInfo.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
using namespace std;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
int main (int argc, char** argv) {

  String* locationPDBDatabase;
  String* locationOut;
  
  if (argc < 3) {
    cout << "Error in the input arguments. The execution must be: " << endl;
    cout << "./ExtractPDBOnlyAlphaBetaCarbons <Path of the folder with pdb files> <Path of the folder to out the new pdb files>" << endl;
    return 0;
  }
  else {
    
    cout << "---------------------------------------------------------------------------------" << endl;
    cout << "             PDB Path : " << argv[1] << endl;
    cout << "Output Protein Folder : " << argv[2] << endl;
    cout << "---------------------------------------------------------------------------------" << endl;
    
    locationPDBDatabase = new String(argv[1]);
    locationOut         = new String(argv[2]);
    
  }

  ExtractPDBInfo* extractPDBInfo = new ExtractPDBInfo();

  cout << "Preparing Files..." << endl;
  extractPDBInfo->Location(locationPDBDatabase);
  extractPDBInfo->LocationProteinOut(locationOut);

  cout << "Generating the PDB files with CA and CB..." << endl;
  extractPDBInfo->GeneratedReducedPDBDatabase();

  cout << "---------------------------------------------------------------------------------" << endl;

  if (extractPDBInfo)      delete extractPDBInfo;
  
  if (locationPDBDatabase) delete locationPDBDatabase;
  if (locationOut)         delete locationOut;

  return 1;
  
}

//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//

